package my.mall.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.time.LocalDateTime;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author fengbo
 * @since 2024-04-22
 */
@TableName("mall_goods")
class Goods {

    /**
     * 商品主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    var id: Long? = null

    /**
     * 数据更新时间
     */
    var updatedTime: LocalDateTime? = null

    /**
     * 数据新建时间
     */
    var createdTime: LocalDateTime? = null

    /**
     * 店铺ID
     */
    var storeId: Long? = null

    /**
     * 创建人ID
     */
    var adminId: Long? = null

    /**
     * 商品名称
     */
    var goodsName: String? = null

    /**
     * 商品卖点
     */
    var sellingPoint: String? = null

    /**
     * 主图
     */
    var mainImgUrl: String? = null

    /**
     * 商品价格-单位分
     */
    var goodsPrice: Int? = null

    /**
     * 初始化销量
     */
    var initSalesVolume: Int? = null

    /**
     * 真实销量
     */
    var realSalesVolume: Int? = null

    /**
     * 商品一级分类
     */
    var categoryId1: Long? = null

    var categoryId2: Long? = null

    var categoryId3: Long? = null

    /**
     * 商品状态(0下架1上架)
     */
    var goodsStatus: Byte? = null

    /**
     * 排序(数字越小越靠前)
     */
    var goodsOrder: Int? = null

    companion object {

        const val ID : String = "id"


        const val UPDATED_TIME : String = "updated_time"


        const val CREATED_TIME : String = "created_time"


        const val STORE_ID : String = "store_id"


        const val ADMIN_ID : String = "admin_id"


        const val GOODS_NAME : String = "goods_name"


        const val SELLING_POINT : String = "selling_point"


        const val MAIN_IMG_URL : String = "main_img_url"


        const val GOODS_PRICE : String = "goods_price"


        const val INIT_SALES_VOLUME : String = "init_sales_volume"


        const val REAL_SALES_VOLUME : String = "real_sales_volume"


        const val CATEGORY_ID1 : String = "category_id1"


        const val CATEGORY_ID2 : String = "category_id2"


        const val CATEGORY_ID3 : String = "category_id3"


        const val GOODS_STATUS : String = "goods_status"


        const val GOODS_ORDER : String = "goods_order"

    }

    override fun toString(): String {
        return "Goods{" +
        "id=" + id +
        ", updatedTime=" + updatedTime +
        ", createdTime=" + createdTime +
        ", storeId=" + storeId +
        ", adminId=" + adminId +
        ", goodsName=" + goodsName +
        ", sellingPoint=" + sellingPoint +
        ", mainImgUrl=" + mainImgUrl +
        ", goodsPrice=" + goodsPrice +
        ", initSalesVolume=" + initSalesVolume +
        ", realSalesVolume=" + realSalesVolume +
        ", categoryId1=" + categoryId1 +
        ", categoryId2=" + categoryId2 +
        ", categoryId3=" + categoryId3 +
        ", goodsStatus=" + goodsStatus +
        ", goodsOrder=" + goodsOrder +
        "}"
    }
}
